package com.jf.hotelreservation.demos.service.impl;

import com.jf.hotelreservation.demos.bean.User;
import com.jf.hotelreservation.demos.mapper.UserMapper;
import com.jf.hotelreservation.demos.service.LoginService;
import com.jf.hotelreservation.demos.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public R login(String username, String password) {
        User login = userMapper.login(username, password);
        if (login != null){
            return R.success();
        }else {
            return R.error("登录失败");
        }
    }
}
